function [ distance ] = Normalized_Cross_Correlation( image1,image2 )
%NORMALIZED_CROSS_CORRELATION Summary of this function goes here
%   Detailed explanation goes here

im1 = load_nifti(image1);
im2 = load_nifti(image2);

mean1 = mean(im1(:));
std1 = std(im1(:));

im1 = (im1 - mean1) ./ std1;

mean2 = mean(im2(:));
std2 = std(im2(:));

im2 = (im2 - mean2) ./ std2;

res = im1.*im2;

distance = mean(res(:));

end

